<template>
  <div>

    <div class="Logout">
      <Logout>退出</Logout>
    </div>
    <h1>更新家族成员信息</h1>

   <div class="image">
   <el-image :src="src2"></el-image>
   <!-- <el-image :src="src1"></el-image> -->
    </div>



    <el-input style="width: 800px" size="medium" v-model="tno" placeholder="请输入人员ID" prefix-icon="el-icon-s-check" maxlength="10" show-word-limit clearable></el-input>
    <el-input style="width: 800px" size="medium" v-model="tname" placeholder="请输入姓名" prefix-icon="el-icon-user-solid" maxlength="50" show-word-limit clearable></el-input>
     <el-input style="width: 800px" size="medium" v-model="thonor" placeholder="请输入家谱ID" prefix-icon="el-icon-s-management" maxlength="50" show-word-limit clearable></el-input>

     
   
   <el-input style="width: 800px" size="medium" v-model="tmarry" placeholder="请输入性别" prefix-icon="el-icon-s-management" maxlength="50" show-word-limit clearable></el-input>

   
    <el-input style="width: 800px" size="medium" v-model="tbirth" placeholder="请输入出生日期" prefix-icon="el-icon-s-data" maxlength="50" show-word-limit clearable></el-input>
    
     <el-input style="width: 800px" size="medium" v-model="tdie" placeholder="请输入死亡日期" prefix-icon="el-icon-s-management" maxlength="50" show-word-limit clearable></el-input>
     
      <el-input style="width: 800px" size="medium" v-model="taddress" placeholder="请输入用户头像" prefix-icon="el-icon-s-management" maxlength="50" show-word-limit clearable></el-input>

      <!-- <el-input style="width: 800px" size="medium" v-model="tpartner" placeholder="请输入家族成员配偶信息" prefix-icon="el-icon-s-management" maxlength="50" show-word-limit clearable></el-input>

      <el-input style="width: 800px" size="medium" v-model="tchild" placeholder="请输入家族成员儿女信息" prefix-icon="el-icon-s-management" maxlength="50" show-word-limit clearable></el-input> -->

      <!-- <el-input style="width: 800px" size="medium" v-model="tlife" placeholder="请输入家族成员生前事迹" prefix-icon="el-icon-s-management" maxlength="50" show-word-limit clearable></el-input> -->

     
     
     
   
    <el-row>
      <el-button @click="updateBtn" type="success" icon="el-icon-upload">提交</el-button>
    </el-row>
  </div>
</template>

<script>
import Logout from "./Logout";
export default {
  name: "UpdateFamily",
  components:{Logout},
  created(){
    this.tno = this.$route.query.tno;
    this.tname = this.$route.query.tname;
    this.tbirth = this.$route.query.tbirth;
    this.tdie = this.$route.query.tdie;
     this.tmarry = this.$route.query.tmarry;
    this.tpartner = this.$route.query.tpartner;
    this.taddress = this.$route.query.taddress;
    this.tchild = this.$route.query.tchild;
     this.tlife = this.$route.query.tlife;
    this.thonor = this.$route.query.thonor;
   
  },
  methods: {
    search(){

    },
    updateBtn(){
      let data = {
        tno:this.tno,
        tname:this.tname,
        tbirth:this.tbirth,
        tdie:this.tdie,
        tmarry :this.tmarry,
        tpartner : this.tpartner,
        taddress :this.taddress,
        tchild :this.tchild,
        tlife :this.tlife,
        thonor :this.thonor
   



      };
      this.$axios.post(`/EditFamily`,data).then((res) => {
        console.log(res);
        if(res.data ==="更新成功"){
          alert("更新成功");

        } else {
          alert(res.data.msg)
        }
      });


    }
  },

  data() {
    return {

      src2:"https://pic1.zhimg.com/80/9bfda4414eb2b012d1f6e88bf32be78c_720w.jpg",
      tno:'',
      tname:'',
      tbirth:'',
      tdie:'',
      tmarry:'',
      tpartner:'',
      tchild:'',
      tlife:'',
      thonor:'',
      taddress:''
   




    }
  }
}
</script>

<style scoped>

</style>
